<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>解构赋值</title>
</head>
<body>
    
</body>
</html>

<script>
    "use strict"
    //数组的使用
    // let [name,url] = ['厚度人','houdurnen.com'];
    // console.log(name,url)

    //解构赋值 数组
    // function hd(){
    //     return ['houdunren','hdcms'];
    // }
    // let [a,b] = hd();
    // console.log(b);

    //剩余解析是指用一个变量来接受剩余参数
    // let [a,...b] = ['houdurnen','hdmcs','xingjundashu'];
    // console.log(a)
    // console.log(b)

    // let web = "厚度柔嫩";
    // let [web,url] = ["hdcms.com","houdunren.com"];
    // console.log(web)

    //字符串解构
    // const [...a] = "houdurnen.com";
    // console.log(a)

    // [web,url] = ['hdcms.com','houdunren.com'];
    // console.log(web)


    //简介定义
    // let [,url] = ['后盾人','hdcms'];
    // console.log(url)


    //使用展开语法获取多个值
    // let [name,...arr] = ['后盾人','hdcms','houdunren.com'];
    // console.log(name,arr)

    //默认值
    //把变量设置为默认值
    // let [name,site='hdcms'] = ['houdurnen'];
    // console.log(site)

    //函数参数
    // function hd([a,b]){
    //     console.log(a,b)
    // }
    // hd(['后盾人','dhcms']);
</script>